package com.kaifamiao.www.ioDemo.do0922;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.nio.charset.Charset;

public class FileReaderTest2 {
    public static void main(String[] args) throws IOException {
        String path = "E:\\kaifamiao\\workspace\\idea--space\\io\\reader.txt";
        FileReader file = new FileReader(path, Charset.forName("gbk"));
        int len;
        char[] ch =new char[2];
        while ((len = file.read(ch))!=-1){
            System.out.println(new String(ch));
        }
    }
}
